package com.tao.mabangbang.controller;

import com.tao.common.core.domain.response.ServiceResponse;
import com.tao.common.web.annotation.Permit;
import com.tao.mabangbang.req.SmsLoginOrRegisterReq;
import com.tao.mabangbang.service.MbbAuthService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/mbbAuth")
public class MbbAuthController {

    @Resource
    private MbbAuthService mbbAuthService;

    @PostMapping("/smsLoginOrRegister")
    public ServiceResponse smsLoginOrRegister(@RequestBody SmsLoginOrRegisterReq req) {
        return mbbAuthService.smsLoginOrRegister(req);
    }

    @Permit
    @GetMapping("/getSmsVerifyCode")
    public ServiceResponse getSmsVerifyCode(String phone) {
        return mbbAuthService.getSmsVerifyCode(phone);
    }


}
